﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="DirectoryManager.cs" company="GT">
//   Gunther Taborga
// </copyright>
// <summary>
//   Defines the DirectoryManager type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace BatchID3.FileSystem.Directory
{
    using System.Collections.Generic;
    using System.IO;

    public class DirectoryManager : IDirectoryManager
    {
        public void CreateDirectory(string path)
        {
            System.IO.Directory.CreateDirectory(path);
        }

        public void DeleteDirectory(string path, bool recursive = false)
        {
            System.IO.Directory.Delete(path, recursive);
        }

        public bool DirectoryExists(string path)
        {
            return System.IO.Directory.Exists(path);
        }

        public IEnumerable<string> GetDirectories(string path)
        {
            return System.IO.Directory.GetDirectories(path);
        }

        public IEnumerable<string> GetDirectories(string path, string searchPattern, SearchOption searchOption = SearchOption.TopDirectoryOnly)
        {
            return System.IO.Directory.GetDirectories(path, searchPattern, searchOption);
        }

        public IEnumerable<string> GetFiles(string path, string searchPattern, SearchOption searchOption = SearchOption.TopDirectoryOnly)
        {
            return System.IO.Directory.GetFiles(path, searchPattern, searchOption);
        }

        public DirectoryInfo GetParent(string path)
        {
            return System.IO.Directory.GetParent(path);
        }
    }
}